]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Make active workspace above siblings
authorKeyu Tao <me@taoky.moe>
Thu, 20 Jun 2024 15:09:27 +0000 (23:09 +0800)
committerKeyu Tao <me@taoky.moe>
Fri, 21 Jun 2024 19:26:31 +0000 (03:26 +0800)
If there's a window flowing over the left edge in a workspace, the
animation of showing or hiding overview in the left adjacent workspace
would glitch, as the window would appear or disappear suddenly.

This commits tries to fix it by making sure the active workspace are
above other workspaces when updating workspaces or active workspace
changed in workspacesView.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7364
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3378>

js/ui/workspacesView.js

index 24c24896db4052aaa7becb190f4cabc8247dfde8..0e962aa4ade6cdcf72d343635ce10e9e8786b9ae 100644 (file)
@@ -440,6 +440,11 @@ class WorkspacesView extends WorkspacesViewBase {
         }
     }
 
+    _raiseActiveWorkspace() {
+        const activeWorkspace = this.getActiveWorkspace();
+        this.set_child_above_sibling(activeWorkspace, null);
+    }
+
     _updateWorkspaces() {
         let workspaceManager = global.workspace_manager;
         let newNumWorkspaces = workspaceManager.n_workspaces;
@@ -472,10 +477,12 @@ class WorkspacesView extends WorkspacesViewBase {
 
         this._updateWorkspacesState();
         this._updateVisibility();
+        this._raiseActiveWorkspace();
     }
 
     _activeWorkspaceChanged(_wm, _from, _to, _direction) {
         this._scrollToActive();
+        this._raiseActiveWorkspace();
     }
 
     _onDestroy() {